/*
 * @Author: 郝奔 1425466221@qq.com
 * @Date: 2024-12-05 16:01:34
 * @LastEditors: 郝奔 1425466221@qq.com
 * @LastEditTime: 2024-12-26 13:26:30
 * @FilePath: /HG-dqbasic_open_platform/src/framework/api/user/types.ts
 * @Description: 
 * Copyright (c) 2024-present HBIS Digital Technology Co.,Ltd. All rights reserved. 
 */
import { ID } from "../common";

/**
 * 登录用户信息
 */
export interface UserInfo {
  nickname: string;
  avatar: string;
  roles: string[];
  perms: string[];
  realName: string;
  organizationId: string;
  authorities: string[];
  wsUrl: string;
  userId: string

}
/**
 * 滑块信息
 */
export interface SliderKaptchaInfo {
  yheight: number;
  backgroundImage: string;
  sliderImage: string;
  kaptchaRequestId: string;
  yHeight: number
}

/**
 * 用户查询参数
 */
export interface UserQuery extends PageQuery {
  keywords: string;
  status: number;
  deptId: ID;
}

/**
 * 用户分页列表项声明
 */
export interface UserType {
  id: ID;
  username: string;
  nickname: string;
  mobile: string;
  gender: number;
  avatar: string;
  email: string;
  status: number;
  deptName: string;
  roleNames: string;
  createTime: string;
}

/**
 * 用户分页项类型声明
 */
export type UserPageResult = PageResult<UserType[]>;

/**
 * 用户表单类型声明
 */
export interface UserForm {
  id: ID;
  deptId: number;
  username: string;
  nickname: string;
  password: string;
  mobile: string;
  email: string;
  gender: number;
  status: number;
  remark: string;
  roleIds: ID[];
}

/**
 * 用户导入表单类型声明
 */
export interface UserImportData {
  deptId: ID;
  roleIds: ID[];
}
// 发送验证码返回参数
export interface SendMailCodeResponse {
  emailRequestId: ID;
  pwdConfig: {
    pwdRegularExpression: string;
    pwdRgDescribe: string
  }
}
// 发送验证码请求参数 
export interface SendMailCodeReq {
  email: string;
  kaptchaRequestId: ID;
  moveLength: number;
  pageKaptchaWidth: number;
  tenantId: ID;
}

// 登录接口返回数据类型
export interface LoginType {
  pwdBeAboutExpired: boolean;
  pwdExpiredDays: number;
  pwdExpiredTime: string;
}

export interface AuthRules {
  tenantId: ID;
}

// 认证策略
export interface RuleWays {
  authWayId: ID;
  authRuleId: ID;
  authWayName: string;
  oneAuthWay: string;
  twoAuthWay: string;
  remark: string;
}

// 短信登录数据类型
export interface SmsLoginData {
  phone: string;
  smsCode: string;
  tenantId: ID;
  smsRequestId: ID; // 短信识别号
  hasKaptcha: boolean; // 是否图片验证码
  kaptchaCode: string;// 图片验证码
  pageKaptchaWidth: string;
  moveLength: number;
  kaptchaRequestId: string;// 图片验证码识别id
  userId: ID;
}

// 发送验证码
export interface AuthSendMail {
  phone: string;
  smsCode: string;
  tenantId: ID;
  smsRequestId: string;
  userId: ID;
  hasKaptcha: boolean;
  kaptchaCode: string;
  kaptchaRequestId: string;
  pageKaptchaWidth: string;
  moveLength: number
}
// 密码策略
export interface PwdType {
  pwdRegularExpression: string;
  pwdRgDescribe: string
}
export interface ExpiredResetPassword {
  tenantId: ID;
  account: string;
  password: string;
  newPassword: string;
  repeatPassword: string;
}
export interface LoginParmas {
  loginRequest: Partial<SmsLoginData>,
  ssoLoginParam: {
    ssoLoginFlag: boolean,
    authMode: string,
    appRedirectUrl: string
  }
}
//租户
export interface TenantListType {
  tenantName: string,
  tenantId: ID
}
export interface FormType {
  account: string;
  password: string;
  tenantId: string;
  hasKaptcha: boolean,
  pageKaptchaWidth: string,
  moveLength: number;
  kaptchaRequestId: string;
}
export interface LoginApiPolicyType {
  loginUser: {
    simpleUserInfo: {
      phone: string;
    },
    userId: ID
  }
}
export interface AuthSendMailCodeType {
  phoneRequestId: string;
}